﻿Public Class ucPhanTrang

    Public Delegate Sub click()
    Public Event TrangDau_Click As click
    Public Event TrangTruoc_Click As click
    Public Event TrangSau_Click As click
    Public Event TrangCuoi_Click As click

    Public Delegate Sub Sua()
    Public Event SuaSoDongTrenTrang As Sua

    Private Sub btnTrangDau_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTrangDau.Click
        RaiseEvent TrangDau_Click()
    End Sub

    Private Sub btnTrangTruoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTrangTruoc.Click
        RaiseEvent TrangTruoc_Click()
    End Sub

    Private Sub btnTrangSau_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTrangSau.Click
        RaiseEvent TrangSau_Click()
    End Sub

    Private Sub btnTrangCuoi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTrangCuoi.Click
        RaiseEvent TrangCuoi_Click()
    End Sub

    Private Sub txtSoDongCuaTrang_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSoDongCuaTrang.KeyPress

        If Char.IsDigit(e.KeyChar) Or Char.IsControl(e.KeyChar) Then
        Else
            e.Handled = True
        End If

    End Sub

    Private Sub txtSoDongCuaTrang_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtSoDongCuaTrang.KeyUp

        If e.KeyCode = Keys.Enter Then
            RaiseEvent SuaSoDongTrenTrang()
        End If
    End Sub
End Class
